import upyun

# 新建又拍云实例
up = upyun.UpYun('1907b','tt1216124438','ahrPZf37Jw6KXBtRxOoF1RrEwKmnapNg')

# 上传文件
# up.put('/upyun_test.txt','sadaad\n加油努力\n')

# 文件流操作（节省内存）
# with open('./code.png','rb') as f:
#     # 上传操作
#     res = up.put('./upyun_test.png',f,checksum=True)

# 目录操作
# up.mkdir('/upyun_test/')

# 移动文件
# up.move('/code.png','./upyun_test/code.png')


# 复制文件
# up.copy('/upyun_test.txt','/upyun_test/upyun_test1.txt')

# 断点续传
# with open('C://Users//lenovo//Videos//Captures/123.mp4','rb') as f:
#     res = up.put('/upyun_test/test.mp4',f,checksum=True,need_resume=True)

# 下载文件
# res = up.get('/upyun_test/code.png')
# print(res)

# 删除文件
# up.delete('/upyun_test/code.png')

